package com.book.store.present.service;

import com.book.store.domain.store.entity.Book;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.lang.Nullable;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.Collection;

@FeignClient(value = "SERVICE-BOOK-STORE", qualifier = "books")
public interface BookStoreService {

    @RequestMapping("books/{id}")
    Book getBook(@PathVariable("id") String id);

    @RequestMapping("books")
    Collection<Book> getBooks();

    @RequestMapping("greeting")
    String greeting(@Nullable @RequestParam(value = "name") String name);
}
